<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->any('upload-image', 'UploadImageController@handle');
    $router->any('upload-file', 'UploadFileController@handle');

    $router->resource('platform', 'Service\PlatformController');
    $router->resource('app-type', 'Service\AppTypeController');
    $router->get('app-type-search', 'Service\AppTypeController@search');
    $router->resource('sys-account', 'Service\SysAccountController');
    $router->resource('micro-app', 'Service\MicroAppController');

    $router->resource('sys-account-menu', 'SysAccount\SysAccountMenuController', ['except' => ['show']]);
    $router->resource('sys-account-keyword-reply', 'SysAccount\SysAccountKeywordReplyController');
    $router->resource('sys-account-follow-reply', 'SysAccount\SysAccountFollowReplyController');
    $router->resource('sys-account-qrcode-reply', 'SysAccount\SysAccountQrcodeReplyController');

    $router->resource('wechat-kf-media', 'Wechat\WechatKfMediaController');

    $router->resource('api-info', 'Api\ApiInfoController');
    $router->resource('sys-account-menu', 'SysAccount\SysAccountMenuController', ['except' => ['create', 'show']]);

    $router->resource('home-banner', 'System\HomeBannerController');
    $router->resource('goods-category', 'System\GoodsCategoryController');
    $router->resource('check-item', 'System\CheckItemController');
    $router->resource('check-time', 'System\CheckTimeController');
    $router->resource('test-location', 'System\TestLocationController');

    $router->resource('coupon', 'Marketing\CouponController');

    $router->resource('question-category', 'Cms\QuestionCategoryController');
    $router->resource('question-answer', 'Cms\QuestionAnswerController');

    $router->resource('user', 'User\UserController');
    $router->resource('wechat-mini-user', 'User\WechatMiniUserController');

    $router->resource('goods-order', 'Order\GoodsOrderController');
    $router->resource('order-sample', 'Sample\OrderSampleController');
});
